package test.gwtlearning.client;

import java.util.Date;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.user.client.ui.TextBox;

public class UiBinderTest1 extends Composite {

	private static final Binder binder = GWT.create(Binder.class);
	@UiField Button button;
	@UiField TextBox textField;
	@UiField Button button_1;

	interface Binder extends UiBinder<Widget, UiBinderTest1> {
	}

	public UiBinderTest1() {
		initWidget(binder.createAndBindUi(this));
	}

	@UiHandler("button")
	void onButtonClick(ClickEvent event) {
		textField.setText((new Date()).toString());
	}
	@UiHandler("button_1")
	void onButton_1Click(ClickEvent event) {
		textField.setText("");
		Window.alert("Hyhyhy");
	}

}
